function match = assessEmotionDataLongitude(data1,data2,excerpt)


emotions = {'Angry','Scared','Sad','Calm','Happy','Excited','Centre','Elsewhere'};

% Allocate the mouse pointer to each of the emotions over the timeseries
for i = 1:6
  [prop(i),dataCat1(:,i)] = checkEmo(emotions{i},data1);
end
for i = 1:6
  [prop(i),dataCat2(:,i)] = checkEmo(emotions{i},data2);
end

dataCat = dataCat1+dataCat2;

[emo,len] = readExcerptData(excerpt);
len = len / 44100 * 25;
match = max(dataCat,[],2) == 2;
match = length(find(match(1:ceil(len))==1))/len;


function [proportion,truevals] = checkEmo(emo,data)

% Get where the emotions are located
[emoPosX,emoPosY, val] = readEmotionPos(emo);
% Check the pointer location
dataTrue(:,1) = (data(:,1) > emoPosX(1)) & (data(:,1) < emoPosX(2));
dataTrue(:,2) = (data(:,2) > emoPosY(1)) & (data(:,2) < emoPosY(2));
% If both are there then it is true
truevals = (dataTrue(:,1) + dataTrue(:,2)) == 2;
% Proportion true to false
proportion = length(find(truevals));

